import classnames from 'classnames'
type Prop = {
  type: string
  onClick?: (e?: React.MouseEvent<SVGUseElement, MouseEvent>) => void
  className?: string
}

export default function Icon({ type, onClick, className }: Prop) {
  return (
    <svg className={classnames('icon', className)} aria-hidden="true">
      <use xlinkHref={`#${type}`} onClick={(e) => onClick && onClick(e)}></use>
    </svg>
  )
}
